package com.project.easy.common.framework.captcha.core.vo;

import java.io.Serializable;
import java.util.Date;

/**
 * @author GreatorMan.cool
 * @copyright: Copyright (c) 2020
 * @company: 扬起科技有限公司
 * @date 2021/11/21 21:51
 * @description: 生成结果返回
 */
public class CaptchResultVo implements Serializable {

    private String imageContent;

    private String captchaKey;

    private String text;

    private Boolean hasSuccess = Boolean.TRUE;

    private Date  expireTime;

    private String result;

    private String bizType;

    private Boolean hasDel;

    public CaptchResultVo(String bizType) {
        this.bizType = bizType;
    }

    public CaptchResultVo() {
    }
    /**
     * 失败
     * @return 返回当前对象
     */
    public  CaptchResultVo fail() {
        this.hasSuccess = Boolean.FALSE;
        return this;
    }

    public Boolean getHasDel() {
        return hasDel;
    }

    public void setHasDel(Boolean hasDel) {
        this.hasDel = hasDel;
    }

    /**
     * @param imageContent 验证码内容
     * @param captchaKey KEY
     * @param text 内容
     * @return 返回数据类型
     */
    public CaptchResultVo success(String imageContent, String captchaKey, String text) {
        this.imageContent = imageContent;
        this.captchaKey = captchaKey;
        this.text = text;
        return this;
    }
    public CaptchResultVo(String imageContent, String captchaKey, String result, Boolean hasSuccess, String text) {
        this.imageContent = imageContent;
        this.captchaKey = captchaKey;
        this.result = result;
        this.hasSuccess = hasSuccess;
        this.text = text;
    }

    public Date getExpireTime() {
        return expireTime;
    }

    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }

    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public Boolean getHasSuccess() {
        return hasSuccess;
    }

    public void setHasSuccess(Boolean hasSuccess) {
        this.hasSuccess = hasSuccess;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getImageContent() {
        return imageContent;
    }

    public void setImageContent(String imageContent) {
        this.imageContent = imageContent;
    }

    public String getCaptchaKey() {
        return captchaKey;
    }

    public void setCaptchaKey(String captchaKey) {
        this.captchaKey = captchaKey;
    }

    @Override
    public String toString() {
        return "CaptchResultVo{" +
                "captchaKey='" + captchaKey + '\'' +
                ", text='" + text + '\'' +
                ", hasSuccess=" + hasSuccess +
                ", expireTime=" + expireTime +
                ", result='" + result + '\'' +
                ", bizType='" + bizType + '\'' +
                '}';
    }
}
